package kmn.udpservice.activity;
import kmn.udpservice.*;

import kmn.udpservice.service.*;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SecActivity extends Activity
{

	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		Button button = (Button)findViewById(R.id.button1);
		Toast.makeText(getApplicationContext(), "Seconde activite", Toast.LENGTH_LONG).show();
		button.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) 
			{
				EditText edit = (EditText)findViewById(R.id.editText1);
				Intent intent = new Intent(getApplicationContext(), UDPservice.class);
				intent.putExtra("editText1", edit.getText().toString());
				startService(intent);

			}
		});
	}
}
